<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui"
      
      xmlns:f="http://java.sun.com/jsf/core">

    <body>

        <ui:composition template="./Stafftemplate.xhtml">

            <ui:define name="top">

            </ui:define>

            <ui:define name="left">

            </ui:define>

            <ui:define name="right">

            </ui:define>

            <ui:define name="content">
                <h2 style="color: red; text-align: center">Change Password</h2>

                <h:form>
                    <table style="margin: auto">
                        <tr>
                            <td style="text-align: right">Current Password:</td>
                            <td><p:password required="true" requiredMessage="Enter your password!" minLength="3" feedback="false" value="#{userBean.oldPass}"/></td>
                        </tr>
                        <tr>
                            <td style="text-align: right">New Password:</td>
                            <td><p:password required="true" requiredMessage="Enter new password!" minLength="3" feedback="true" value="#{userBean.newPass1}"/></td>
                        </tr>
                        <tr>
                            <td style="text-align: right">Re-type Password:</td>
                            <td><p:password required="true" requiredMessage="Re-type new password!" minLength="3" feedback="false" value="#{userBean.newPass2}"/></td>
                        </tr>                        
                        <tr>
                            <p:growl id="growl" showDetail="true" showSummary="true"/>
                            <td style="text-align: right"><p:commandButton update="growl" value="Change" ajax="false" actionListener="#{userBean.changePassword(e)}"/></td>
                            <td style="text-align: center"><p:commandButton value="Cancel" ajax="true" immediate="true" actionListener="#{userBean.cancelAdmin(e)}"/></td>
                        </tr>
                    </table>                   
                </h:form>

            </ui:define>

            <ui:define name="bottom">

            </ui:define>

        </ui:composition>

    </body>
</html>
